//
//  MyNView.m
//  Four_Fit_New
//
//  Created by xalo on 16/7/14.
//  Copyright © 2016年 xmaz. All rights reserved.
//

#import "MyNView.h"

@interface MyNView ()

@end

@implementation MyNView


- (instancetype)init{
    self = [super initWithFrame:CGRectMake(0, 0, kWidth, 64)];
    if (self) {
        
    }
    return self;
}

- (UIButton *)leftButton{
    if (!_leftButton) {
        _leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_leftButton setTitle:@"<Back" forState:UIControlStateNormal];
        _leftButton.frame = CGRectMake(15, 27, 120, 32);
        _leftButton.titleLabel.textColor = [UIColor whiteColor];
        
        [self addSubview:_leftButton];
    }
    return _leftButton;
}
- (UIButton *)rightButton{
    if (!_rightButton) {
        _rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _rightButton.frame = CGRectMake(kWidth - 37, 27, 32, 32);
        _rightButton.titleLabel.textColor = [UIColor whiteColor];
        [self addSubview:_rightButton];
    }
    return _rightButton;
}
- (UIButton *)littleRightButton{
    if (!_littleRightButton) {
        _littleRightButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _littleRightButton.frame = CGRectMake(kWidth - 37 - 37, 27, 32, 32);
        _littleRightButton.titleLabel.textColor = [UIColor whiteColor];
        [self addSubview:_littleRightButton];
    }
    return _littleRightButton;
}
- (UIImageView *)imageView{
    if (!_imageView) {
        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
        _imageView.clipsToBounds = YES;
        _imageView.contentMode = UIViewContentModeBottom;
        UIVisualEffectView *visView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
        visView.frame = _imageView.bounds;
        [_imageView addSubview:visView];
        [self insertSubview:_imageView atIndex:0];
    }
    return _imageView;
}
- (UILabel *)titlabel{
    if (!_titlabel) {
        _titlabel = [[UILabel alloc] initWithFrame:CGRectMake((kWidth - 200) / 2, 27, 200, 32)];
        _titlabel.textColor = [UIColor whiteColor];
        _titlabel.textAlignment = NSTextAlignmentCenter;
        _titlabel.font = [UIFont fontWithName:@"HelveticaNeue" size:17];
        [self addSubview:_titlabel];
    }
    return _titlabel;
}
@end
